package Day2025_04_09;

import java.util.Arrays;
import java.util.Scanner;

public class Demo02 {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Integer[] arr = new Integer[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr, (a, b) -> b - a);
        print(arr, n);
    }
    private static void print (Integer[] arr, int n) {
        if (n == 1) {
            System.out.println(arr[1]);
            return;
        }
        long ret = 0;
        for (int i = 1; i < 2 * n; i += 2) {
            ret += arr[i];
        }
        System.out.println(ret);
    }
}
